package com.lh.pospi.x_store.view;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.lh.pospi.x_store.R;
import com.vondear.rxui.view.dialog.RxDialog;

public class RxEdite2Dialog extends RxDialog {
    private EditText et1;
    private EditText et2;
    private EditText et_user;
    private EditText et_pwd;
    private TextView d_title;
    private TextView d_name1;
    private TextView d_name2;
    private TextView d_bt1;
    private TextView d_bt2;
    private String user;
    private String pwd;

    public String getUser() {
        return et_user.getText().toString().trim();
    }

    public String getPwd() {
        return et_pwd.getText().toString().trim();
    }
    public void setEt_user(String msg) {
        et_user.setText(msg);
    }

    public void setEt_pwd(String msg) {
        et_pwd.setText(msg);

    }

    public RxEdite2Dialog(Context context, int themeResId) {
        super(context, themeResId);
        initView();
    }

    public EditText getEt1() {
        return et1;
    }

    public EditText getEt2() {
        return et2;
    }

    public RxEdite2Dialog(Context context, boolean cancelable, OnCancelListener cancelListener) {
        super(context, cancelable, cancelListener);
        initView();
    }

    public RxEdite2Dialog(Context context) {
        super(context);
        initView();
    }

    public RxEdite2Dialog(Context context, float alpha, int gravity) {
        super(context, alpha, gravity);
        initView();
    }

    public void setSureOnclickLister(View.OnClickListener lister) {
        d_bt2.setOnClickListener(lister);
    }
    public void setCancleOnclickLister(View.OnClickListener lister) {
        d_bt1.setOnClickListener(lister);
    }
    public void setTitle(String msg){
        d_title.setText(msg);
    }
    public void setSureBtText(String msg){
        d_bt2.setText(msg);
    }
    public void setCancleBtText(String msg){
        d_bt1.setText(msg);
    }
    public void setEt1Text(String msg){
        et1.setText(msg);
    }
    public void setEt2Text(String msg){
        et2.setText(msg);
    }
    public String getEt1Msg(){
        return et1.getText().toString().trim();
    }
    public String getEt2Msg(){
        return et2.getText().toString().trim();
    }

    private void initView() {
        View dialogView = LayoutInflater.from(this.getContext()).inflate(R.layout.dialog_edit, (ViewGroup)null);
        this.et1 = (EditText) dialogView.findViewById(R.id.et1);
        this.et2 = (EditText) dialogView.findViewById(R.id.et2);
        d_title = dialogView.findViewById(R.id.d_title);
        d_name1 = dialogView.findViewById(R.id.d_et_name1);
        d_name2 = dialogView.findViewById(R.id.d_et_name2);
        d_bt1 = dialogView.findViewById(R.id.d_bt1);
        d_bt2 = dialogView.findViewById(R.id.d_bt2);
        et_user = dialogView.findViewById(R.id.et_user);
        et_pwd = dialogView.findViewById(R.id.et_pwd);
        this.setContentView(dialogView);
    }

    @Override
    public void setCancelable(boolean flag) {
        super.setCancelable(flag);
    }
}
